package org.reliablesource.prism.gef.editor.figures;

import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.MouseEvent;
import org.eclipse.draw2d.MouseMotionListener;
import org.eclipse.draw2d.PolylineConnection;
import org.reliablesource.prism.gef.editor.PrismScreenEditor;

/**
 *
 *  PrismPolylineConnection.java
 *  Copyright (c) 2006, Reliable Source, Inc. All Rights Reserved
 *
 *	Created on: Apr 30, 2006 
 *  @author Dennis Park <a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
 *
 */

public class PrismPolylineConnection extends PolylineConnection{

	Label l;
	
	public PrismPolylineConnection(){
		super();
		l = new Label();
		this.setToolTip(l);
		this.addMouseMotionListener(new MouseMotionListener(){

			public void mouseDragged(MouseEvent me) {
			}

			public void mouseEntered(MouseEvent me) {
			}

			public void mouseExited(MouseEvent me) {
			}

			public void mouseHover(MouseEvent me) {
				me.getLocation();
				l.setText(me.getLocation().x + ", " + me.getLocation().y);
				PrismScreenEditor.setPointerLocationToStatusLine(me.getLocation());
			}

			public void mouseMoved(MouseEvent me) {
			}
			
		});
	}	
}
